package book;

public class PriorityTest {
	
	public static class MyThread extends Thread{
		
		public long count;
		
		@Override
		public void run(){
			
			while(true){
				
				count++;
			}
		}
		
		public long getCount(){
			
			return this.count;
		}
	} 

	public static void main(String[] args) throws InterruptedException {
		
		MyThread t1 = new MyThread();
		t1.setPriority(Thread.MIN_PRIORITY);
		
		MyThread t2 = new MyThread();
		t2.setPriority(Thread.MAX_PRIORITY);
		
		t1.start();
		t2.start();
		
		Thread.sleep(60000);
		t1.stop();
		t2.stop();
		
		System.out.println(t1.getCount());
		System.out.println(t2.getCount());
	}
}
